const https = require('./https')
const Redis = require('ioredis')
const Promise = require('bluebird')
const mongodb = require('./mongoose')
class Siwi {
    constructor () {
        this.$http = new https()
        // this.$redis = new Redis(6379, '127.0.0.1')      
        this.test()
        return this
    }
    async test() {
        let uri = 'https://demo.sznzkj.cn/test?name=mankong&id=2'    
        let data = {
            "data_start": "2017-08-21",
            "data_end": "2017-08-26",
            "email": "sznzkj#sznzkj.cn"
        }
        
        let res =  await this.$http.get(uri, data)
        let id = res.id 
        try {
            mongodb.connect()
        } catch (error) {
            console.trace(error)
        }    
        // let res = await this.$redis.get('TEST')
        // let re = await this.$redis.set('SZNZKJ_TEST:'+id, JSON.stringify(res))
        console.log(res)
        return false;
    }
    
}

const S = new Siwi()
